from timeit import timeit
from structure.myqueue import MyQueue, LinkedListQueue
from structure.loopqueue import LoopQueue


def test_myqueue():
    queue = MyQueue()
    for i in range(100000):
        queue.enqueue(i)
    for i in range(100000):
        queue.dequeue()


def test_loopqueue():
    queue = LoopQueue(100000)
    for i in range(100000):
        queue.enqueue(i)
    for i in range(100000):
        queue.dequeue()


def test_LinkListQueue():
    queue = LinkedListQueue()
    for i in range(100000):
        queue.enqueue(i)
    for i in range(100000):
        queue.dequeue()


if __name__ == "__main__":
    t1 = timeit(stmt=test_myqueue, number=3)
    t2 = timeit(stmt=test_loopqueue, number=3)
    t3 = timeit(stmt=test_LinkListQueue, number=3)

    print(t1, t2, t3)